import { computed, ref } from 'vue'

// 当前激活标签
const activeTab = ref<'brandSet' | 'unit' | 'type' | 'para' | 'warrantyPolicy' | 'field'>(
  'brandSet',
)

export default () => {
  /**
   * 设置激活标签
   * @param {'brandSet' | 'unit' | 'type' | 'para' | 'warrantyPolicy' | 'field'} tab - 标签名
   */
  const setActiveTab = (tab: typeof activeTab.value) => {
    activeTab.value = tab
  }

  // 获取激活标签
  const getActiveTab = computed(() => {
    return activeTab.value
  })

  return {
    setActiveTab,
    getActiveTab,
  }
}
